<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
	<meta http-equiv="content-type" content="text/html; charset=utf-8" />
	<meta name="author" content="Tigers group" />
    <meta name="language" content="en" />
    <link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/ie.css" />
    <link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->theme->baseUrl; ?>/css/main.css" />    
    <link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->theme->baseUrl; ?>/css/form.css" />
    <link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/screen.css" />
    
    
	<title><?php echo CHtml::encode($this->pageTitle); ?> Tigers group</title>
</head>

<body>
<div id="header">
    <div id="logo"></div>
    <div id="panel"></div>
    <div id="mainmenu">
		<?php $this->widget('zii.widgets.CMenu',array(
			'items'=>array(
				array('label'=>'Home', 'url'=>array('/site/index')),
				array('label'=>'About', 'url'=>array('/site/page', 'view'=>'about')),
				array('label'=>'Contact', 'url'=>array('/site/contact')),
                                array('label'=>'Đăng kí', 'url'=>'index.php?r=users/create'),
                                array('label'=>'Đổi mật khẩu', 'url'=>'index.php?r=users/update&id='.Yii::app()->user->getId()),
                                array('label'=>'User profiles', 'url'=>array('/userprofiles/message', 'id'=>Yii::app()->user->getId())),
				array('label'=>'Login', 'url'=>array('/site/login'), 'visible'=>Yii::app()->user->isGuest),
				array('label'=>'Logout ('.Yii::app()->user->name.')', 'url'=>array('/site/logout'), 'visible'=>!Yii::app()->user->isGuest),                                
			),
		)); ?>
    </div><!-- mainmenu -->
</div>
<div id="wrapper">
        <div id="sidebar">
            <div class="box-2">
                <div class="box-title-color orange"></div>
                <div class="box-title">
                    User action
                </div>
                <div class="box-content">
                    <?php
                        if (!Yii::app()->user->isGuest){
                            echo "Chào bạn, ".Yii::app()->user->name; echo "<br>";
                            //$profiles = UserProfiles::model()->findByAttributes(array('user_id'=>Yii::app()->user->id));
                            //if ($profiles) echo "teie";
                            //print('<img width="200" height="150" src ="data/avatars/'.$profiles->avatar.'/>');
                            echo '<a href="index.php?r=drug/create">Đăng bài mới</a><br>';
                       }
                    ?>

                </div>
            </div>
            <div class="box-2">
                <div class="box-title-color orange"></div>
                <div class="box-title">
                    Các loại thuốc
                </div>
                <div class="box-content">
                    <h3>Loại thuốc 1</h3>
                    <h3>Loại thuốc 2</h3>
                    <h3>Loại thuốc 3</h3>
                    <h3>Loại thuốc 4</h3>
                    <h3>Loại thuốc 5</h3>                
                </div>
            </div>
            <div class="box-2">
                <?php
                    $this->widget('SearchBlock', array()); 
                ?>
            </div>
        </div><!--end slider-->
    
    <div id="mainpage">
        <?php echo $content; ?>
    </div><!--end mainpage-->
    
    <div class="clear"></div>
    
</div> <!--end wapper-->
<div id="footer">
    Copyright &copy; <?php echo date('Y'); ?> by Tigers group.<br/>
		All Rights Reserved.<br/>
</div><!--end footer-->
</body>
</html>